

package com.hazelcast.internal.jmx.suppliers;

import com.hazelcast.internal.monitor.impl.LocalMapStatsImpl;
import com.hazelcast.map.IMap;
import com.hazelcast.map.LocalMapStats;

/**
 * Implementation of {@link StatsSupplier} for {@link LocalMapStats}
 */
public class LocalMapStatsSupplier implements StatsSupplier<LocalMapStats> {

    private final IMap map;

    public LocalMapStatsSupplier(IMap map) {
        this.map = map;
    }

    @Override
    public LocalMapStats getEmpty() {
        return new LocalMapStatsImpl();
    }

    @Override
    public LocalMapStats get() {
        return map.getLocalMapStats();
    }
}
